﻿@model IEnumerable<EasyUILearn.Models.Sys_Companys>

@{
    ViewBag.Title = "Basic TreeGrid - jQuery EasyUI Demo";
}




<link rel="stylesheet" type="text/css" href="~/Scripts/easyui1.5/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="~/Scripts/easyui1.5/themes/icon.css">
<link rel="stylesheet" type="text/css" href="~/Scripts/easyui1.5/demo/demo.css">
<script type="text/javascript" src="~/Scripts/easyui1.5/jquery.min.js"></script>
<script type="text/javascript" src="~/Scripts/easyui1.5/jquery-easyui.min.js"></script>
<script type="text/javascript" src="~/Scripts/DIY/utils.js"></script>



<h2>Basic TreeGrid</h2>
<p>TreeGrid allows you to expand or collapse group rows.</p>
<div style="margin: 20px 0;"></div>


<table id="tt" title="Folder Browser" >
</table>
<script type="text/javascript">
    $('#tt').treegrid({
        url: 'http://localhost:1250/api/TreeGridAPI',
        idField: 'KeyId',
        treeField: 'CoShortName',
        method : 'Get',
        columns: [[
            { title: 'Name', field: 'CoShortName' }
        ]]
        , loadFilter: function (data) {
            
            data = utils.toTreeData(data, 'KeyId', 'ParentId', "children");
            return data;
        }
    });

</script>

